<!-- MSWE01 双人单轮对阵表 -->
<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">对阵表</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="game-info">
      <el-col :span="3">
        <div>{{ tableData.column1 }}</div>
      </el-col>
      <el-col :span="9">
        <div class="game-a">东西向</div>
      </el-col>
      <el-col :span="3">
        <div class="game-vs">{{ tableData.column3 }}</div>
      </el-col>
      <el-col :span="9">
        <div class="game-b">南北向</div>
      </el-col>
    </div>
    <div class="game-table-data">
      <el-row :gutter="24">
        <el-col :span="3" class="col-style-1">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="Table" label="桌号" header-align="center" align="center">
            </el-table-column>
            <!-- <el-table-column
              prop="Remark"
              label="备注"
              header-align="center"
              align="center"
            ></el-table-column> -->
          </el-table>
        </el-col>
        <el-col :span="9" class="col-style">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="HomeNo" label="编号"> </el-table-column>
            <el-table-column label="姓名" min-width="130%">
              <template slot-scope="scope">
                <div style="color:rgba(230,24,71,1)">
                  {{ scope.row.HomeName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="HomeTeam" label="单位"> </el-table-column>
            <!-- <el-table-column
              prop="HomeScore"
              label="前轮积分"
              header-align="center"
              align="center"
              width="100"
            ></el-table-column> -->
          </el-table>
        </el-col>
        <el-col :span="3" class="col-style">
          <el-table :data="reportData" style="width: 100%" header-align="center">
            <el-table-column prop="" header-align="center">
              <template slot="header" slot-scope="scope">
                <div class="game-vs-logo"></div>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
        <el-col :span="9" class="col-style-2">
          <el-table :data="reportData" style="width: 100%">
            <!-- <el-table-column
              prop="GuestScore"
              label="前轮积分"
              header-align="center"
              align="center"
              width="100"
            ></el-table-column> -->
            <el-table-column prop="GuestTeam" label="单位"> </el-table-column>
            <el-table-column prop="GuestName" label="姓名" min-width="130%">
              <template slot-scope="scope">
                <div style="color:rgba(60,135,247,1)">
                  {{ scope.row.GuestName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="GuestNo" label="编号"> </el-table-column>
          </el-table>
        </el-col>
      </el-row>
      <!-- <el-table :data="reportData" style="width: 100%">
        <template v-for="(item, index) in tableHeader">
          <el-table-column
            :label="item.label"
            :prop="item.prop"
            :fixed="item.fixed"
            :width="item.width"
          ></el-table-column>
        </template>
      </el-table> -->
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      tableData: {
        column1: '对阵',
        column2: '东西向',
        column3: 'VS',
        column4: '南北向'
      },
      tableHeader: [
        { prop: 'Table', label: '桌号', width: '65' },
        { prop: 'HomeNo', label: '东西向编号' },
        { prop: 'HomeTeam', label: '东西向单位' },
        { prop: 'HomeName', label: '东西向牌手' },
        { prop: 'HomeScore', label: '东西向上轮积分', width: '150px' },
        { prop: 'GuestScore', label: '南北向上轮积分', width: '150px' },
        { prop: 'GuestNo', label: '南北向编号' },
        { prop: 'GuestTeam', label: '南北向单位' },
        { prop: 'GuestName', label: '南北向牌手' },
        { prop: 'Remark', label: '备注' }
      ],
      tableData: {
        column1: '对阵',
        column2: '黑棋',
        column3: 'VS',
        column4: '白棋'
      },
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      startList: [
        {
          Table: 'A',
          HomeNo: '1',
          HomeTeam: '1',
          HomeName: '李轩豪 ',
          HomeScore: '2',
          GuestScore: '重庆',
          GuestNo: '0',
          GuestTeam: '2',
          GuestName: '李建宇 ',
          Remark: '河北'
        }
      ],
      singleItemList: [
        {
          name: '掼牌（掼蛋）',
          logo: '',
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
